home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / MPW Related / DTS MPW Goodies / SetMarkers < prev    next >
Encoding:
Text File  |  1990-09-14  |  1.3 KB  |  46 lines  |  [TEXT/MPS ]

  1. #--------------------------------------------------------------------------------------------------
  2. #                    S E T M A R K E R S            24.5.89
  3. #
  4. # To set marks for a unit UMyUnit assumed to be in files UMyUnit.p, UMyUnit.inc1.p,...
  5. # Simply select the directory containing the unit and execute 
  6. #                            SetMarkers UMyUnit
  7. #--------------------------------------------------------------------------------------------------
  8.  
  9. # Use procnames to build mark commands for procedure/function names in file {1}.marks
  10. procnames {1}.p -o -m > {1}.marks
  11.  
  12. # Now add marks for the object declarations in the interface part
  13. open {1}.p -t
  14. open {1}.marks -t
  15. # Position at start of interface file
  16. find • {1}.p
  17. # Skip first 2 lines of current marks
  18. find 2Δ {1}.marks
  19. set CaseSensitive 0
  20. Set Exit 0
  21. loop
  22.     # Position at start of a line containing "??????=?????OBJECT"
  23.     find Δ/•(?+=[ ∂t]*OBJECT)/ {1}.p
  24.     # Break if end of file
  25.     if {status} != 0
  26.         Break
  27.     end
  28.     # Find the name of the object in the line
  29.     find /[ ∂t]*/Δ:/[A-Z0-9_]+/ {1}.p
  30.     # Copy it to the clipboard
  31.     copy § {1}.p
  32.     # Build a Mark command for the object name
  33.     replace § 'Mark -y /•([ ∂t]*' {1}.marks
  34.     paste § {1}.marks
  35.     replace § ')?*OBJECT≈/ "' {1}.marks
  36.     paste § {1}.marks
  37.     replace § '"'∂n {1}.marks
  38. end
  39. Set Exit 1
  40. close {1}.p
  41. close {1}.marks -y
  42. # Apply the marks
  43. {1}.marks
  44. close -a
  45. delete {1}.marks
  46.